package com.atguigu.crowd.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class CrowdWebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {

        //view-controller是在project-consumer内部定义的，所以这里是一个不经过Zuul访问的地址，所以不用加/project

        //发起众筹
        registry.addViewController("/agree/protocol/page.html").setViewName("project-agree");

        //阅读并同意协议
        registry.addViewController("/launch/project/page.html").setViewName("project-launch");

        //回报设置
        registry.addViewController("/return/info/page.html").setViewName("project-return");

        //确认信息
        registry.addViewController("/create/confirm/page.html").setViewName("project-confirm");

        //保存成功
        registry.addViewController("/create/success.html").setViewName("project-success");
    }
}
